package fr.licpro.filebox.service;

import retrofit.client.Response;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
import retrofit.http.Query;
import fr.licpro.filebox.dto.response.TokenDto;

/**
 * Interface for REST API
 */
public interface IRestClient {
	
	/**
	 * Method for create a new user
	 * HTTP VERB - POST
	 * @author Sylvain Le Gouellec
	 * @since 1.0.0
	 * @param user		Login.
	 * @param password	Password.
	 */
	 @POST("/rest/customer")
	 void createUser(@Query("login") String user, @Query("password") String password);

	 /**
	  * Getting token of user connected
	  * HTTP VERB - PUT
	  * @author Sylvain Le Gouellec
	  * @since 1.0.0
	  * @param user		Login.
	  * @param password	Password.
	  */
	 @PUT("/rest/customer/token")
	 TokenDto getToken(@Query("login") String user, @Query("password") String password);

	 /**
	  * Get root files to user connected
	  * Only files modified are returned.
	  * HTTP VERB - GET
	  * @author Sylvain Le Gouellec
	  * @since 1.0.0
	  * @param token		User's token.
	  * @param timestamp	TimeStamp of the last modification.
	  * @return	Return a response with files present to root folder
	  */
	 @GET("/rest/file/{token}")
	 Response getRootFiles(@Path("token") String token,@Query("data") String timestamp);

	 /**
	  * Get files into a folder
	  * Only files modified are returned.
	  * HTTP VERB - GET
	  * @author Sylvain Le Gouellec
	  * @since 1.0.0
	  * @param token		User's token.
	  * @param hashid		ID of the element asking.
	  * @param timestamp	TimeStamp of the last modification.
	  * @return	Return a response  with files present to folder with a hashID equals to hasid passed in paramater.
	  */
	 @GET("/rest/file/{token}/{hasId}")
	 Response getDirectoryContent(@Path("token") String token, @Path("hasId") String hashid ,@Query("data") String timestamp);

}
